function handleRegister() {
    const username = document.getElementById('username').value;
    const email = document.getElementById('email').value;
    const password = document.getElementById('password').value;
    const confirmPassword = document.getElementById('confirm-password').value;
    const messageElement = document.getElementById('message');

    // 简单的验证
    if (password !== confirmPassword) {
        messageElement.textContent = '密码和确认密码不匹配！';
        messageElement.style.color = 'red';
        return false;
    }

    // 在这里可以进行进一步的处理，例如发送数据到服务器
    messageElement.textContent = '注册成功！';
    messageElement.style.color = 'green';

    // 阻止表单的默认提交行为
    return false;
}
